6 FenwickTree(int _maxSize
) : maxSize(_maxSize
+1) {
7 v
= vector
<long long>(maxSize
, 0LL);
10 void add(int where
, long long what
){
11 for (where
++; where
<= maxSize
; where
+= where
& -where
){
16 long long query(int where
){
18 for (where
++; where
> 0; where
-= where
& -where
){
24 long long query(int from
, int to
){
25 return query(to
) - query(from
-1);